package com.example.zxw.ui.views.smartrefresh.header

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.example.zxw.ui.views.smartrefresh.RefreshState


@Composable
fun CnsHeader(state: RefreshState){

    Box(
        contentAlignment = Alignment.Center,
        modifier = Modifier
            .height(100.dp)
            .fillMaxWidth()
            .background(Color.LightGray)
    ) {
        if (state == RefreshState.RELEASE_REFRESH) {
            Text(
                text = "释放刷新",
            )
        } else if (state == RefreshState.REFRESHING) {
            Text(
                text = "刷新中...",
            )
        } else {
            Text(
                text = "下拉刷新",
            )
        }

    }
}